Coder Social home page Coder Social logo

automationpanda / tau-intro-to-pytest Goto Github PK

View Code? Open in Web Editor NEW
113.0 6.0 91.0 20 KB

Introduction to pytest: A Test Automation University Course

Home Page: https://testautomationu.applitools.com/pytest-tutorial/

License: Apache License 2.0

Python 100.00%
pytest python python3 tau test-automation test-automation-university api-testing playwright requests unit-testing

tau-intro-to-pytest's People

Contributors

andylpk247 avatar automationpanda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

tau-intro-to-pytest's Issues

[Ch.5: Unit Testing Classes] import error introduced: "ModuleNotFoundError: No module named 'stuff'"

After diff-checking and confirming that my code & file structure was 1:1 with Pandy Knight's, im left thinking an error is introduced within the chapter 5 section, at the accumulator class' import statement in the /test_accum.py file
from stuff.accum import Accumulator

Either that, or PyCharm (2023.2.2 (Community Edition)) or Python (v3.12.0) dislikes how im attempting to import the Accumulator class from the stuff directory. After attempts to resolve it failed I pulled down the course repo and called python3 -m pytest -v test_accum.py on the repo version to be greeted with the same error:

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ERROR collecting test_accum.py _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

ImportError while importing test module '/PycharmProjects/test-automation-university/venv/tau-pytest/tests/test_accum.py'.
Hint: make sure your test modules/packages have valid Python names.

Traceback:
/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
test_accum.py:2: in <module>
    from stuff.accum import Accumulator
E   ModuleNotFoundError: No module named 'stuff'

Since im new to it, I considered that PyCharm did some virtual environment or PATHing oddness(?), though this was also the errored outcome when I used another IDE like VSC.

If any additional info is needed i'll do my best to provide it.
[Screenshot below was taken while troubleshooting with a duplicate file, creatively named 'stuff2']
Screenshot 2023-10-06 at 7 13 12 PM

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.