Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove double application of env vars from profile #4380

Merged
merged 10 commits into from Jan 28, 2019
@@ -164,7 +164,6 @@ def _parse_conan_txt(self, contents, path, display_name, processed_profile):

# imports method
conanfile.imports = parser.imports_method(conanfile)
conanfile._conan_env_values.update(processed_profile._env_values)
return conanfile

def load_virtual(self, references, processed_profile, scope_options=True,
@@ -0,0 +1,19 @@
import platform
import unittest

from conans import ConanFile, Settings
from conans.client.generators.virtualenv import VirtualEnvGenerator
from conans.model.env_info import EnvValues
from conans.test.utils.tools import TestBufferConanOutput


@unittest.skipUnless(platform.system() == "Windows", "Test both .sh and .bat files")
This conversation was marked as resolved by danimtb

This comment has been minimized.

Copy link
@SSE4

SSE4 Jan 25, 2019

Contributor

why not mock platform.system()?

This comment has been minimized.

Copy link
@danimtb

danimtb Jan 28, 2019

Author Member

I have moved this check inside the test so it is not skipped when out of windows

class VirtualenvGeneratorTest(unittest.TestCase):

def prepend_values_test(self):

This comment has been minimized.

Copy link
@danimtb

danimtb Jan 25, 2019

Author Member

This test checks that is not the fault of the virtualenv generator

conanfile = ConanFile(TestBufferConanOutput(), None)
conanfile.initialize(Settings({}), EnvValues.loads("PATH=[1,2,three]"))
gen = VirtualEnvGenerator(conanfile)
content = gen.content
self.assertIn("PATH=\"1\":\"2\":\"three\":$PATH", content["activate.sh"])
self.assertIn("PATH=1;2;three;%PATH%", content["activate.bat"])
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.