Anyone has ideas on why running `tox` fails but running the same test in the tox-created venv passed?
Here is an example test:
metrics.py
```
def get_test_value():
return {1 : 'd', 2: 'e'}
def _test_func():
metrics = get_test_value().values()
metrics = [info for info in metrics]
return metrics
```
metrics_test.py:
```
from metrics import _test_func
class TestMetrics(unittest.TestCase):
def test_example(self):
return_value1 = {'metric_func_name': 'a'}
…
[View More]return_value2 = {'metric_func_name': 'b'}
expect(target).get_test_value.once().and_return({
'test1': return_value1,
'test2': return_value2,
})
self.assertEqual(_test_func(), [return_value1, return_value2])
```
This test fails half of the time because the order can change:
```
E AssertionError: Lists differ: [{'metric_func_name': 'b'}, {'... != [{'metric_func_name': 'a'}, {'...
E
E First differing element 0:
E {'metric_func_name': 'b'}
E {'metric_func_name': 'a'}
E
E - [{'metric_func_name': 'b'}, {'metric_func_name': 'a'}]
E ? ^ ^
E
E + [{'metric_func_name': 'a'}, {'metric_func_name': 'b'}]
E ?
```
[View Less]
Hi All,
First of all I am a newb so please be gentle. I want to add a platform
specific command to commands_pre. I followed the example so my tox.ini
looks something like the following:
```
[tox]
minversion = 2.0
envlist = full-{linux,macos,mswin}, nightly-{linux,macos,mswin}
skipsdist = True
[testenv]
# environment will be skipped if regular expression does not match against
the sys.platform string
platform = linux: linux
macos: darwin
mswin: win32
commands_pre =
…
[View More] linux: -bash -c 'some command here'
[testenv:myspecificenv]
commands = {[testenv]commands} -k myspecificenv
...
...
The issue is that tox is being invoked with
tox -e myspecificenv
And this doesn't pick up the platform and this doesn't run the platform
specific pre command.
I am probably looking at this wrong so please help.
Thanks,
Sergio.
[View Less]