Python : NameError: name 'StandardError' is not defined
Asked Answered
N

1

1

I'm currently developing a website with the SST - Web Test Framework (i'm very beginner) but I have a problem with python

I used this Link: https://pypi.python.org/pypi/sst/0.2.2

I m using - Python 3.6.4 and SST - Web Test Framework- Latest Version: 0.2.4

My Code is:

from sst.actions import *
go_to('http://www.google.com/')

Error is:

C:\Python\scrapy-master\Projects>python proxyhar.py
Traceback (most recent call last):
File "proxyhar.py", line 1, in <module>
from sst.actions import *
File "C:\Python\lib\site-packages\sst\actions.py", line 104, in <module>
class EndTest(StandardError):
NameError: name 'StandardError' is not defined

Anyone suggest me how to resolve this.

Thank you

Nominative answered 1/3, 2018 at 15:30 Comment(7)
Sounds like a bug in SST. Given that it hasn't been updated in five years I'd ditch it.Presidentelect
if you try doing the test like assert_title_contains('google') do you still get an error?Impetus
You get the error even without go_to('http://www.google.com/'), right?Backfield
@Evusas Yes, I write only from sst.actions import * this line then also its getting same errorNominative
@Fix3r Yes.....Nominative
Do you need to install the module through pip install?Impetus
@Daniel'O'Brien got it right. It's just Python2 has StandardError class, but you must be using Python3. You could create virtual environment with Python2 and install this module through pip there if you want to keep using it.Backfield
P
5

sst only supports Python 2 even though pip will let you install it for Python 3. The error NameError: name 'StandardError' is not defined is from sst trying to use the built in exception StandardError which was removed in Python 3. To resolve this, you can either use a different module (which I would recommend) or downgrade to Python 2.7.

Prom answered 1/3, 2018 at 16:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.