Skip to content

Commit

Permalink
Fix typechecking issue with Python 3.10 (#308)
Browse files Browse the repository at this point in the history
Summary:
**What:**

Fix a typechecking error when building TestSlide on Python 3.10 that was found in Fedora (https://bugzilla.redhat.com/show_bug.cgi?id=1981718).

**Why:**

```
testslide/runner.py:288: error: Incompatible types in assignment (expression has type "BaseException", variable has type "Union[Exception, AggregatedExceptions]")
Found 1 error in 1 file (checked 26 source files)
make: *** [Makefile:87: mypy] Error 1
```

**How:**

Adding the missing type

**Risks:**

It's typechecking

**Checklist**:

<!--
Have you done all of these things?
To check an item, place an "x" in the box like so: "- [x] Tests"
Add "N/A" to the end of each line that's irrelevant to your changes
-->

- [ ] Added tests, if you've added code that should be tested N/A
- [ ] Updated the documentation, if you've changed APIs N/A
- [x] Ensured the test suite passes
- [x] Made sure your code lints
- [x] Completed the Contributor License Agreement ("CLA")

Pull Request resolved: #308

Reviewed By: davide125

Differential Revision: D29678774

Pulled By: deathowl

fbshipit-source-id: aeaa0d3ec5bcedd178edbf0fcf747dbeae1ebe37
  • Loading branch information
davide125 authored and facebook-github-bot committed Jul 13, 2021
1 parent 538b5ba commit 8b0c16c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion testslide/runner.py
Expand Up @@ -312,7 +312,7 @@ def print_failed_example(
self,
number: int,
example: Example,
exception: Union[Exception, AggregatedExceptions],
exception: Union[Exception, AggregatedExceptions, BaseException],
) -> None:
self.print_bright(
" {number}) {context}: {example}".format(
Expand Down

0 comments on commit 8b0c16c

Please sign in to comment.