How to use _get_envconfig method in tox

Best Python code snippet using tox_python

test_config.py

Source:test_config.py Github

copy

Full Screen

...845 config = newconfig(args, tox_ini)846 finally:847 tox._config.make_hashseed = original_make_hashseed848 return config.envconfigs849 def _get_envconfig(self, newconfig, args=None, tox_ini=None):850 envconfigs = self._get_envconfigs(newconfig, args=args,851 tox_ini=tox_ini)852 return envconfigs["python"]853 def _check_hashseed(self, envconfig, expected):854 assert envconfig.setenv == {'PYTHONHASHSEED': expected}855 def _check_testenv(self, newconfig, expected, args=None, tox_ini=None):856 envconfig = self._get_envconfig(newconfig, args=args, tox_ini=tox_ini)857 self._check_hashseed(envconfig, expected)858 def test_default(self, tmpdir, newconfig):859 self._check_testenv(newconfig, '123456789')860 def test_passing_integer(self, tmpdir, newconfig):861 args = ['--hashseed', '1']862 self._check_testenv(newconfig, '1', args=args)863 def test_passing_string(self, tmpdir, newconfig):864 args = ['--hashseed', 'random']865 self._check_testenv(newconfig, 'random', args=args)866 def test_passing_empty_string(self, tmpdir, newconfig):867 args = ['--hashseed', '']868 self._check_testenv(newconfig, '', args=args)869 @pytest.mark.xfail(sys.version_info >= (3,2),870 reason="at least Debian python 3.2/3.3 have a bug: "871 "http://bugs.python.org/issue11884")872 def test_passing_no_argument(self, tmpdir, newconfig):873 """Test that passing no arguments to --hashseed is not allowed."""874 args = ['--hashseed']875 try:876 self._check_testenv(newconfig, '', args=args)877 except SystemExit:878 e = sys.exc_info()[1]879 assert e.code == 2880 return881 assert False # getting here means we failed the test.882 def test_setenv(self, tmpdir, newconfig):883 """Check that setenv takes precedence."""884 tox_ini = """885 [testenv]886 setenv =887 PYTHONHASHSEED = 2888 """889 self._check_testenv(newconfig, '2', tox_ini=tox_ini)890 args = ['--hashseed', '1']891 self._check_testenv(newconfig, '2', args=args, tox_ini=tox_ini)892 def test_noset(self, tmpdir, newconfig):893 args = ['--hashseed', 'noset']894 envconfig = self._get_envconfig(newconfig, args=args)895 assert envconfig.setenv is None896 def test_noset_with_setenv(self, tmpdir, newconfig):897 tox_ini = """898 [testenv]899 setenv =900 PYTHONHASHSEED = 2901 """902 args = ['--hashseed', 'noset']903 self._check_testenv(newconfig, '2', args=args, tox_ini=tox_ini)904 def test_one_random_hashseed(self, tmpdir, newconfig):905 """Check that different testenvs use the same random seed."""906 tox_ini = """907 [testenv:hash1]908 [testenv:hash2]...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run tox automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful