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.

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.

https://docs.python.org/3/library/stdtypes.html#union-type

  • platform infos: Test session starts (platform: darwin, Python 3.9.9, pytest 7.1.2, pytest-sugar 0.9.4)

image

Error Infos Screenshot as below:

image

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
The-Compilercommented, Aug 24, 2022

You probably have multiple installs of pytest, and aren’t executing the one you think you are - see which pytest to see which one gets picked up. It will be the first one found in your $PATH.

1reaction
RonnyPfannschmidtcommented, Aug 24, 2022

That’s a user error, the syntax is supposed to be used with python 3.10 or by enabling the annotations future

Read more comments on GitHub >

github_iconTop 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 >

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