Closed SweetVishnya closed 3 years ago
Traceback (most recent call last):
File "C:\Users\vishnya\AppData\Roaming\Python\Python36\Scripts\unittest-parallel-script.py",
line 11, in <module>
load_entry_point('unittest-parallel==1.1.0', 'console_scripts', 'unittest-parallel')()
File "C:\Users\vishnya\AppData\Roaming\Python\Python36\site-packages\unittest_parallel\main.p
y", line 75, in main
test_suites = test_loader.discover(args.start_directory, pattern=args.pattern, top_level_di
r=args.top_level_directory)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\unittest\loader.p
y", line 338, in discover
raise ImportError('Start directory is not importable: %r' % start_dir)
Yes, Windows is fully supported. Unit tests all pass on Windows with 100% branch coverage. I also verified that unittest-parallel works with a real-world project on Windows.
What does your source tree look like?
Creating __init__.py
in tests
helped. But now it runs my unittest functions sequential.
How many TestCase classes do you have?
unitest-parallel runs unit tests for all TestClass classes in parallel. If you have only one TestCase class, there will be no parallelization.
The reason for this is that TestCase's setUp method implies that per-test-case state may be applied to the test case instance - and thus, tests within a TestClass instance can, in general, only safely be run one at a time.
I have two TestCase classes, one function each.
Hmmm... How many test files?
One test file.
I will take a look at that case.
What happens if you break your tests into multiple files?
They run in parallel. So, this does not work with one file.
How are you defining your unit tests within the single file? An example would be helpful.
This is an issue even when defining multiple TestCase classes in a single file - they are run as a single aggregate test suite. It would be far better to run each separately. I'm looking into a fix.
This is an issue even when defining multiple TestCase classes in a single file - they are run as a single aggregate test suite. It would be far better to run each separately. I'm looking into a fix.
This is exactly my case.
Now parallelize based on TestCase's, not just top-level test suites.
Released unittest-parallel 1.2.0
Hi!
Do you support Windows?