TypeError: unsupported operand type(s) for |: 'type' and 'type'
See original GitHub issue- invoking
pytest -m ....throws an ERROR , cuz I used union-type in functions.
- platform infos: Test session starts (platform: darwin, Python 3.9.9, pytest 7.1.2, pytest-sugar 0.9.4)

Error Infos Screenshot as below:

Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
TypeError: unsupported operand type(s) for |: 'type ... - GitHub
This causes TypeError: unsupported operand type(s) for |: 'type' and 'type' when I import this file into ipython, but not when I run...
Read more >TypeError: unsupported operand type(s) for +: 'type' and 'str'
What you are trying to do is called "casting". This converts one type to another. eg: converting an integer value of 1 to...
Read more >TypeError: unsupported operand type(s) for +: int and str
The Python "TypeError: unsupported operand type(s) for +: 'int' and 'str'" occurs when we try to use the addition (+) operator with an...
Read more >Python TypeError: unsupported operand type(s) for -: 'str' and ...
The “TypeError: unsupported operand type(s) for -: 'str' and 'int'” error is raised when you try to subtract a string from an integer....
Read more >TypeError unsupported operand type(s) for + 'int' and 'str'
The concatenation operator “+” is used for this. But while doing so, a common error that is encountered is “TypeError unsupported operand type(s)...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

You probably have multiple installs of
pytest, and aren’t executing the one you think you are - seewhich pytestto see which one gets picked up. It will be the first one found in your$PATH.That’s a user error, the syntax is supposed to be used with python 3.10 or by enabling the annotations future