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.

pytest watch seems to fail when pyproject.toml is used as a config file

See original GitHub issue

When pytest config is stored in pyproject.toml:

Traceback (most recent call last):
  File "/Users/maximilian/Library/Caches/pypoetry/virtualenvs/n-cyukv0jK-py3.8/bin/ptw", line 8, in <module>
    sys.exit(main())
  File "/Users/maximilian/Library/Caches/pypoetry/virtualenvs/n-cyukv0jK-py3.8/lib/python3.8/site-packages/pytest_watch/command.py", line 83, in main
    if not merge_config(args, pytest_args, verbose=args['--verbose']):
  File "/Users/maximilian/Library/Caches/pypoetry/virtualenvs/n-cyukv0jK-py3.8/lib/python3.8/site-packages/pytest_watch/config.py", line 95, in merge_config
    config.read(config_path)
  File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/configparser.py", line 697, in read
    self._read(fp, filename)
  File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/configparser.py", line 1113, in _read
    raise e
configparser.ParsingError: Source contains parsing errors: '/Users/maximilian/workspace/n/pyproject.toml'
	[line 59]: ']\n'

This works when the pytest config in pyproject.toml is removed

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:36
  • Comments:5

github_iconTop GitHub Comments

5reactions
Jufikcommented, Aug 11, 2022

Faced the same issue and investigated my pyproject.toml

anytime you have

variable=[
    ....
]

I change to (note the 4 spaces)

variable=[
    ....
    ]

PTW works like a charm

0reactions
sicksidcommented, Sep 7, 2022

btw moving pytest configuration form pyproject.toml to pytest.ini did the trick but I would prefer to not have extra config files

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · joeyespo/pytest-watch - GitHub
Local continuous test runner with pytest and watchdog. ... pytest watch seems to fail when pyproject.toml is used as a config file. #114...
Read more >
pytest-watch - Bountysource
pytest watch seems to fail when pyproject.toml is used as a config file $ 0 ... When pytest is wrapped by ptw, I...
Read more >
All my poetry commands fail with 'The Poetry config is invalid'
A multi-line string is not valid for the description field. The error message does not match '^[^\n]*$' is telling you that it is...
Read more >
pytest Documentation - Read the Docs
The first test passed and the second failed. You can easily see the intermediate values in the assertion to help you under-.
Read more >
How to capture warnings — pytest documentation
The same option can be set in the pytest.ini or pyproject.toml file using the filterwarnings ini option. For example, the configuration below will...
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