Update ex5_6.md to fix NameError in example code

Calling Stock() directly without providing the name of the module will result in the following error:

NameError: name 'Stock' is not defined

This fixes the bug in the example code.
This commit is contained in:
Jarle Thorsen 2023-10-23 12:27:05 +02:00 committed by GitHub
parent afec76dd94
commit 1d20aaeca8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,7 +25,7 @@ import stock
class TestStock(unittest.TestCase):
def test_create(self):
s = Stock('GOOG', 100, 490.1)
s = stock.Stock('GOOG', 100, 490.1)
self.assertEqual(s.name, 'GOOG')
self.assertEqual(s.shares, 100)
self.assertEqual(s.price, 490.1)