RosesDurden / pysimplesoap

Automatically exported from code.google.com/p/pysimplesoap
0 stars 0 forks source link

Cannot run test suite on Ubuntu 12.04 with python 2.7.3 #134

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. git clone https://github.com/pysimplesoap/pysimplesoap.git
2. cd pysimplesoap
3. python tests/suite.py

Traceback (most recent call last):
  File "tests/suite.py", line 40, in <module>
    test()
  File "tests/suite.py", line 12, in test
    from . import soapdispatcher_test
ValueError: Attempted relative import in non-package

4. python -m unittest discover

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK

5. python -m unittest tests/suite.py 
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/lib/python2.7/unittest/__main__.py", line 12, in <module>
    main(module=None)
  File "/usr/lib/python2.7/unittest/main.py", line 94, in __init__
    self.parseArgs(argv)
  File "/usr/lib/python2.7/unittest/main.py", line 149, in parseArgs
    self.createTests()
  File "/usr/lib/python2.7/unittest/main.py", line 158, in createTests
    self.module)
  File "/usr/lib/python2.7/unittest/loader.py", line 128, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/usr/lib/python2.7/unittest/loader.py", line 91, in loadTestsFromName
    module = __import__('.'.join(parts_copy))
ImportError: Import by filename is not supported.

Original issue reported on code.google.com by jslow...@gmail.com on 6 Feb 2014 at 8:58

GoogleCodeExporter commented 8 years ago
You can run test suite with:
$ python -m unittest discover -s tests/ -p '*.py'

Original comment by gaetano....@spacespa.it on 10 Feb 2014 at 12:04

GoogleCodeExporter commented 8 years ago
Also, you can run:

$ pyhon -m tests.suite

The following way is documented in the README.md:

$ python -m unittest discover

BTW, both work on Ubuntu 14.04

Original comment by reingart@gmail.com on 25 May 2014 at 3:43