learn-co-curriculum / python-p3-oop-putting-it-all-together Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
https://learning.flatironschool.com/courses/6329/assignments/239706?module_item_id=563645
line 74 and 80:
the pytest should either be changed to lib/testing/book_test.py (same for shoe_test) or specify to navigate into lib before running in command line
No response
the pytest should either be changed to lib/testing/book_test.py (same for shoe_test) or specify to navigate into lib before running in command line
https://learning.flatironschool.com/courses/6049/assignments/195257?module_item_id=439030
We can basically pass all the tests to this lab by give Book
and Shoe
an __init__
method and a turn_page
and cobble
method, respectively. Once we have these set up, all the other tests automatically pass, since python allows you to assign attributes freely. If this is meant to illustrate the ease of OOP with Python, then it's great.
But, this could also be an opportunity for students to practice using properties more. We don't have to make all attributes properties, but at least making a few of them properties could be good practice. It could also highlight the difference between non-properties, whose tests would pass as soon as the class is set up, and properties, which would need to meet certain requirements. Thoughts?
No response
No response
https://learning.flatironschool.com/courses/6049/assignments/195257?module_item_id=439030
No fork button on “Putting It All Together: Object-Oriented Programming Lab”
No response
No response
https://learning.flatironschool.com/courses/6049/assignments/195257?module_item_id=439030
No response
No response
https://learning.flatironschool.com/courses/6049/assignments/195257?module_item_id=439030
The tests don't work as they do not recognize that the class containing the student's code is accessible by the testing files.
____________________________ ERROR collecting testing/shoe_test.py _____________________________
ImportError while importing test module '/Users/eleanorkelman/Documents/Python Phase 3 Labs/python-p3-oop-putting-it-all-together/lib/testing/shoe_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../../.pyenv/versions/3.8.13/lib/python3.8/importlib/init.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
testing/shoe_test.py:3: in
from shoe import Shoe
E ModuleNotFoundError: No module named 'shoe'
No response
In lib/testing/shoe_test.py in test test_requires_int_size one of the asserts is commented out.
def test_requires_int_size(self):
'''prints "size must be an integer" if size is not an integer.'''
stan_smith = Shoe("Adidas")
captured_out = io.StringIO()
sys.stdout = captured_out
stan_smith.size = "not an integer"
sys.stdout = sys.stdout
# assert captured_out.getvalue() == "size must be an integer\n"
assert not stan_smith.size
https://learning.flatironschool.com/courses/6049/assignments/195257?module_item_id=439030
This commit above added the code necessary to pass all the tests. The test suite passes upon cloning the lab down.
No response
Remove the class body code from both Shoe and Book, and replace both bodies with pass
es
https://learning.flatironschool.com/courses/6049/assignments/195257?module_item_id=439030
Unclear why we need the turtle library imported for this lab. When I run pytest, the shoe_test.py file errors out and can't seem to get tkinter (not sure how I have turtle but not the dependencies it needs so that's a big question mark).
No response
Remove the import turtle line from shoe_test.py and it ran smoothly for me!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.