question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] get_sdist_metadata return value in tests can change

See original GitHub issue
(py38) denolf@lindenolf:~/dev/grayskull$ pip list | grep souschef
conda-souschef                2.2.1
(py38) denolf@lindenolf:~/dev/grayskull$ pip list | grep gray
grayskull                     1.5.1.dev3+g62509c4.d20220728      (current main branch)

This test passes when I run it like this

pytest tests/test_pypi.py::test_compose_test_section_with_console_scripts

but fails when I do this

pytest tests/test_pypi.py

Somehow get_sdist_metadata returns something different in both cases. Not sure why.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
marcelotrevisanicommented, Jul 29, 2022

but it can be improved, indeed, putting something like

except KeyboardInterrupt:
    sys.exit()

before the BaseException to cover this case

0reactions
marcelotrevisanicommented, Jul 29, 2022

there are a few bugs in the past that was not covered by using just exception. Some exceptions like SystemExit and GeneratorExit are not covered by using just Exception, the BaseException there is needed

Ok but this means grayskull cannot be interrupted or killed when inside injection_distutil.

It cannot be killed by KeyboardInterrupt, but sigkill works as normal

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to change jest mock function return value in each test?
You can mock the module so it returns spies and import it into your test: import {navigationEnabled, guidanceEnabled} from '../../.
Read more >
unittest.mock — mock object library
It allows you to replace parts of your system under test with mock ... You can also specify return values and set needed...
Read more >
Catch more bugs: How to produce unit tests in real time
Using a little regular expression magic, you can extract class names, methods, parameters, and return values, and then modify the code in-place, ...
Read more >
Best practices for writing unit tests - .NET
Repeatable: Running a unit test should be consistent with its results, that is, it always returns the same result if you don't change...
Read more >
Managing return values with PHPUnit mock objects
How to use PHPUnit mock objects to create a virtual laboratory for testing components. Set up stub objects to return values via simple ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found