Taichi: [misc] python tests error that doesn't affect program execution

Created on 3 Jun 2020  路  4Comments  路  Source: taichi-dev/taichi

Describe the bug
When running ti test, the main program throws an error saying that it is unable to recognize the argument -n1

Log/Screenshots

Running python tests...

ERROR: usage: ti [options] [file_or_dir] [file_or_dir] [...]
ti: error: unrecognized arguments: -n1
inifile: None
rootdir: /home/peiyuanl/taichi_dev/taichi

========================================================== test session starts ===========================================================
platform linux -- Python 3.7.6, pytest-5.4.2, py-1.8.1, pluggy-0.13.1
rootdir: [omitted]
plugins: xdoctest-0.12.0, cov-2.9.0

(the test successfully completed)

To Reproduce

Run ti test after correct setup and compilation on Ubuntu 16.04

good first issue potential bug python

Most helpful comment

Sure!

All 4 comments

tl;dr: pip install pytest-xdist.

For now we have to detect the pytest plugin xdist by running a dummy test:
https://github.com/taichi-dev/taichi/blob/e9b30006e8d34ab37350b8c0fda588fa7df06c74/python/taichi/main.py#L624-L629

It would be great if we can find some pytest API to detect if xdist is installed or not, would you mind to fix this? Thanks in advance!

Sure!

I dug around and I think there isn't a easy work around.

  • I tried sys.module and xdist isn't listed
  • Then I tried some voodoo path parsing magic, and it seems that after uninstalling pytest-xdist, the folder still persists, so that didn't work either.

I guess right now we can print a few extra messages explaining that the error message is insignificant...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

liaopeiyuan picture liaopeiyuan  路  3Comments

yuanming-hu picture yuanming-hu  路  3Comments

kazimuth picture kazimuth  路  4Comments

archibate picture archibate  路  4Comments

g1n0st picture g1n0st  路  3Comments