Giter VIP home page Giter VIP logo

Comments (2)

The-Compiler avatar The-Compiler commented on June 16, 2024

This exits with code 1:

class TestBug
    def test_bug(self) -> None:
        assert True

ERROR tests/unit/server/util/garbo_test.py

This is a SyntaxError during collection, causing no tests to ever run, and pytest to exit with exit status 2. After fixing the missing :, this is a passing test. There is no reason why it should fail.

edit: Ah, I suppose the syntax error might have been intended, and I see how you could get the output you posted. However, I don't see why this should exit with exit code 1 rather than 2. Are you actually running pytest, or some wrapper script around it?

This exits with code 0:

class TestBug:
    def test_bug(self) -> None:
        a = fake_var

ERROR tests/unit/server/util/garbo_test.py::TestBug::test_bug - NameError: name 'fake_var' is not defined

I see no reason why it should, this seems like an issue in your environment of some sort (e.g. a wrapper script around pytest).

If the SyntaxError wasn't intended, please show a complete, runnable example that actually exhibits the problem you're describing- and in any case, please show the full output of running pytest and getting the exit code on it.

from pytest.

clekas-fff avatar clekas-fff commented on June 16, 2024

You were right! I found a sneaky conftest that was manipulating the reports in an incorrect way. Thanks

from pytest.

Related Issues (20)

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.