Ex 47, File Errors after successful nosetest

Hi Guys

I was just wondering if anyone else had Errors in their file for ex47?

I was able to make EX47 run with nosetests in what I think was a successful termination, however
my VScode program showed 8 errors in my - tests/ ex47_tests.py file, namely:

Unable to import ‘nose.tools’
Undefined variable ‘assert_equal’

The nosetests seemed to work after a bit of troubleshooting and playing around with the
“ModuleNotFoundError: No module named ‘ex47.game’” problem, but I worry I may have overlooked something and that something may be critically wrong with my interpretation…

If anyone else has any words of advice or encountered the same thing, please let me know, for my sanities sake!

That means you didn’t install nose, OR, you did but you put it in a virtual environment, but are now not using it. Does that sound familiar?

Hi Zed

Thank you for the reply, so I went back and installed nose again, got into my virtual environment, and still I seem to have those errors linger…

(lpthw) Claudios-iMac-2:skeleton Nick$ nosetests

Ran 6 tests in 0.007s

OK

This is what the test shows when run though, so it doesn’t seem to have an issue here, but my Problems window still shows the:

Unable to import ‘nose.tools’
Undefined variable ‘assert_equal’

Could it be because nose isn’t available in Py3, cause when I tried to check if it was installed, I could only see it when I checked the list using only pip, and not pip3…

Try this:

Install Nosetest for Python 3

To install:

sudo apt-get install python-nose python3-nose

To run:

nosetests-2.7 ; nosetests3

or

python3.6 -m "nose"

This runs the test suite under both PY2 and PY3.

Source: https://stackoverflow.com/a/39502750/3926777

Yes, try this python -m trick @DidierCH mentions. It may be that.