Error when running an example

Asked by Callistus on 2012-08-28

I get the following error when running the yahoofinance script.

(ENV) C:\>C:\Python27\python c:\Env\scripts\sst-run yahoofinance
----------------------------------------------------------------------
starting SST...

  date time: 2012-08-28 15:37
  test directory: '.'
  report format: 'console'
  browser type: 'Firefox'
  javascript disabled: False
  browswermob proxy launcher: None
  shared directory: None
  screenshots on error: False
  failfast: False
  debug: False
  headless xserver: False

Traceback (most recent call last):
  File "c:\Env\scripts\sst-run", line 190, in <module>
    main()
  File "c:\Env\scripts\sst-run", line 94, in main
    debug=cmd_opts.debug,
  File "C:\Python27\lib\site-packages\sst\runtests.py", line 84, in runtests
    alltests = TestSuite(suites)
  File "C:\Python27\lib\site-packages\unittest2\suite.py", line 15, in __init__
    self.addTests(tests)
  File "C:\Python27\lib\site-packages\unittest2\suite.py", line 53, in addTests
    for test in tests:
  File "C:\Python27\lib\site-packages\sst\runtests.py", line 81, in <genexpr>
    not os.path.split(root)[1].startswith('_')
  File "C:\Python27\lib\site-packages\sst\runtests.py", line 227, in get_suite
    failfast=failfast, debug=debug
  File "C:\Python27\lib\site-packages\sst\runtests.py", line 314, in get_case
    test_name: test, 'run': run}
TypeError: a new-style class can't have only classic bases

Question information

Language:
English Edit question
Status:
Answered
For:
selenium-simple-test Edit question
Assignee:
No assignee Edit question
Last query:
2012-08-30
Last reply:
2012-09-07
Corey Goldberg (coreygoldberg) said : #1

this is very strange, and I can't reproduce (on Ubuntu with Python 2.7).

I found the line of code your stack trace points to... Could you try to run the following from a Python prompt, and let me know the result:

>>> import unittest
>>> type('foo', (unittest.TestCase,), {})

does it throw the same exception you saw?

-Corey

Callistus (noelcallistus) said : #2

I had the above code in a test.py file and ran it from the python prompt. Here is the result.

(ENV) C:\>C:\Python27\python c:\Env\scripts\sst-run test
----------------------------------------------------------------------
starting SST...

  date time: 2012-08-30 15:51
  test directory: '.'
  report format: 'console'
  browser type: 'Firefox'
  javascript disabled: False
  browswermob proxy launcher: None
  shared directory: None
  screenshots on error: False
  failfast: False
  debug: False
  headless xserver: False

Traceback (most recent call last):
  File "c:\Env\scripts\sst-run", line 190, in <module>
    main()
  File "c:\Env\scripts\sst-run", line 94, in main
    debug=cmd_opts.debug,
  File "C:\Python27\lib\site-packages\sst\runtests.py", line 84, in runtests
    alltests = TestSuite(suites)
  File "C:\Python27\lib\site-packages\unittest2\suite.py", line 15, in __init__
    self.addTests(tests)
  File "C:\Python27\lib\site-packages\unittest2\suite.py", line 53, in addTests
    for test in tests:
  File "C:\Python27\lib\site-packages\sst\runtests.py", line 81, in <genexpr>
    not os.path.split(root)[1].startswith('_')
  File "C:\Python27\lib\site-packages\sst\runtests.py", line 227, in get_suite
    failfast=failfast, debug=debug
  File "C:\Python27\lib\site-packages\sst\runtests.py", line 314, in get_case
    test_name: test, 'run': run}
TypeError: a new-style class can't have only classic bases

Callistus (noelcallistus) said : #3

The test if run by themselves work fine.
(ENV) C:\>C:\Python27\python C:\Python27\sst-0.2.1\examples\seleniumhq.py

    Starting Firefox
    Going to... http://seleniumhq.org/
    Waiting for get_element

Corey Goldberg (coreygoldberg) said : #4

I just noticed how you are invoking SST in your original post.

(ENV) C:\>C:\Python27\python c:\Env\scripts\sst-run yahoofinance

you are inside a virtualenv, but calling the system python version. don't do that.

if your virtualenv is named 'ENV', that is where you invoke SST from. (after you activate the virtualenv).
Something like:

(ENV) C:\ENV> Scripts\sst-run yahoofinance

Can you help with this problem?

Provide an answer of your own, or ask Callistus for more information if necessary.

To post a message you must log in.