You also need to add this line in the tests in tests_query.cpp where the environment variable is being set. As the tests are a single process, setting the environment, and not unsetting it at the end of each test where it is set, can bleed the value over to other tests.
58 + ASSERT_ EQ(unsetenv( Configuration: :PURCHASES_ ENVVAR) , 0);
You also need to add this line in the tests in tests_query.cpp where the environment variable is being set. As the tests are a single process, setting the environment, and not unsetting it at the end of each test where it is set, can bleed the value over to other tests.