Skip to content

Commit

Permalink
Fix test_syntax not to use identity comparison on string
Browse files Browse the repository at this point in the history
Fix test_syntax to compare strings via "==" rather than "is", in order
to fix test failure on PyPy3.
  • Loading branch information
mgorny committed Feb 1, 2022
1 parent 94273ee commit 8e3a0be
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Add support for US spelling of "gray" in ANSI color names https://github.com/Textualize/rich/issues/1890

### Fixed

- Fixed `test_syntax.py::test_from_path_lexer_override` test failure on PyPy3 https://github.com/Textualize/rich/pull/1904

## [11.1.0] - 2022-01-28

### Added
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Expand Up @@ -27,3 +27,4 @@ The following people have contributed to the development of Rich:
- [Nicolas Simonds](https://github.com/0xDEC0DE)
- [Gabriele N. Tornetta](https://github.com/p403n1x87)
- [Patrick Arminio](https://github.com/patrick91)
- [Michał Górny](https://github.com/mgorny)
2 changes: 1 addition & 1 deletion tests/test_syntax.py
Expand Up @@ -277,7 +277,7 @@ def test_from_path_lexer_override():
try:
os.write(fh, b"import this\n")
syntax = Syntax.from_path(path, lexer="rust")
assert syntax.lexer.name is "Rust"
assert syntax.lexer.name == "Rust"
assert syntax.code == "import this\n"
finally:
os.remove(path)
Expand Down

0 comments on commit 8e3a0be

Please sign in to comment.