diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2021-01-17 07:44:58 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-17 16:44:58 +0100 |
commit | debda34e2d4f28d6d369cdafdcba4791702f63fc (patch) | |
tree | 68799677bf5f81be5e32af24670277721adc5845 /tests | |
parent | 19d2096185de3282345eab1da611e56a26bcaec2 (diff) | |
download | pygments-git-debda34e2d4f28d6d369cdafdcba4791702f63fc.tar.gz |
Run pyupgrade across codebase to modernize syntax and patterns (#1622)
pyupgrade is a tool to automatically upgrade syntax for newer versions
of the Python language.
The project has been Python 3 only since
35544e2fc6eed0ce4a27ec7285aac71ff0ddc473, allowing for several cleanups:
- Remove unnecessary "-*- coding: utf-8 -*-" cookie. Python 3 reads all
source files as utf-8 by default.
- Replace IOError/EnvironmentError with OSError. Python 3 unified these
exceptions. The old names are aliases only.
- Use the Python 3 shorter super() syntax.
- Remove "utf8" argument form encode/decode. In Python 3, this value is
the default.
- Remove "r" from open() calls. In Python 3, this value is the default.
- Remove u prefix from Unicode strings. In Python 3, all strings are
Unicode.
- Replace io.open() with builtin open(). In Python 3, these functions
are functionally equivalent.
Co-authored-by: Matthäus G. Chajdas <Anteru@users.noreply.github.com>
Diffstat (limited to 'tests')
67 files changed, 17 insertions, 85 deletions
diff --git a/tests/__init__.py b/tests/__init__.py index 50d4621b..0b017eee 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Pygments test package ~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/support/empty.py b/tests/support/empty.py index 40a96afc..e69de29b 100644 --- a/tests/support/empty.py +++ b/tests/support/empty.py @@ -1 +0,0 @@ -# -*- coding: utf-8 -*- diff --git a/tests/support/html_formatter.py b/tests/support/html_formatter.py index 169cd4af..5f04fd57 100644 --- a/tests/support/html_formatter.py +++ b/tests/support/html_formatter.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from pygments.formatters import HtmlFormatter diff --git a/tests/support/python_lexer.py b/tests/support/python_lexer.py index 565ee674..78d9c4ad 100644 --- a/tests/support/python_lexer.py +++ b/tests/support/python_lexer.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # pygments.lexers.python (as CustomLexer) for test_cmdline.py from pygments.lexers import PythonLexer diff --git a/tests/test_analyze_lexer.py b/tests/test_analyze_lexer.py index 0391507e..d2dba038 100644 --- a/tests/test_analyze_lexer.py +++ b/tests/test_analyze_lexer.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Pygments basic API tests ~~~~~~~~~~~~~~~~~~~~~~~~ @@ -17,8 +16,7 @@ TESTDIR = path.dirname(path.abspath(__file__)) def _guess_lexer_for_file(filename): - return lexers.guess_lexer(open(path.join(TESTDIR, 'examplefiles', filename), - 'r', encoding='utf-8').read()) + return lexers.guess_lexer(open(path.join(TESTDIR, 'examplefiles', filename), encoding='utf-8').read()) @pytest.mark.skip(reason="This is identified as T-SQL") diff --git a/tests/test_apache_conf.py b/tests/test_apache_conf.py index a19cb842..94aebc9a 100644 --- a/tests/test_apache_conf.py +++ b/tests/test_apache_conf.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Basic Apache Configuration Test ~~~~~~~~~~~~~~~~~-------------- diff --git a/tests/test_asm.py b/tests/test_asm.py index b972c102..6c5665bb 100644 --- a/tests/test_asm.py +++ b/tests/test_asm.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Basic GasLexer/NasmLexer Test ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_basic.py b/tests/test_basic.py index fd054ddb..4488d34e 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Pygments Basic lexers tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_basic_api.py b/tests/test_basic_api.py index b860060b..24e42ca2 100644 --- a/tests/test_basic_api.py +++ b/tests/test_basic_api.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Pygments basic API tests ~~~~~~~~~~~~~~~~~~~~~~~~ @@ -186,7 +185,7 @@ def test_formatter_encodings(): # encoding and outencoding option fmt = HtmlFormatter(encoding="latin1", outencoding="utf8") tokens = [(Text, "ä")] - assert "ä".encode("utf8") in format(tokens, fmt) + assert "ä".encode() in format(tokens, fmt) @pytest.mark.parametrize('cls', [getattr(formatters, name) @@ -272,7 +271,7 @@ class TestFilters: # We don't read as binary and decode, but instead read as text, as # we need consistent line endings. Otherwise we'll get \r\n on # Windows - with open(TESTFILE, 'r', encoding='utf-8') as fp: + with open(TESTFILE, encoding='utf-8') as fp: text = fp.read() tokens = list(lx.get_tokens(text)) assert all(isinstance(t[1], str) for t in tokens), \ diff --git a/tests/test_bibtex.py b/tests/test_bibtex.py index b56eccf3..e47869d5 100644 --- a/tests/test_bibtex.py +++ b/tests/test_bibtex.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ BibTeX Test ~~~~~~~~~~~ diff --git a/tests/test_cfm.py b/tests/test_cfm.py index 54cf502c..096bc876 100644 --- a/tests/test_cfm.py +++ b/tests/test_cfm.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Basic ColdfusionHtmlLexer Test ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_clexer.py b/tests/test_clexer.py index c636f7f2..dba1e40e 100644 --- a/tests/test_clexer.py +++ b/tests/test_clexer.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Basic CLexer Test ~~~~~~~~~~~~~~~~~ diff --git a/tests/test_cmdline.py b/tests/test_cmdline.py index 731729d9..b92a9035 100644 --- a/tests/test_cmdline.py +++ b/tests/test_cmdline.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Command line test ~~~~~~~~~~~~~~~~~ diff --git a/tests/test_coffeescript.py b/tests/test_coffeescript.py index 60ddfcd8..5d69a8aa 100644 --- a/tests/test_coffeescript.py +++ b/tests/test_coffeescript.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ CoffeeScript tests ~~~~~~~~~~~~~~~~~~ @@ -54,17 +53,17 @@ def test_coffee_slashes(lexer, golden): def test_mixed_slashes(lexer): - fragment = u'a?/foo/:1/2;\n' + fragment = 'a?/foo/:1/2;\n' tokens = [ - (Token.Name.Other, u'a'), - (Token.Operator, u'?'), - (Token.Literal.String.Regex, u'/foo/'), - (Token.Operator, u':'), - (Token.Literal.Number.Integer, u'1'), - (Token.Operator, u'/'), - (Token.Literal.Number.Integer, u'2'), - (Token.Punctuation, u';'), - (Token.Text, u'\n'), + (Token.Name.Other, 'a'), + (Token.Operator, '?'), + (Token.Literal.String.Regex, '/foo/'), + (Token.Operator, ':'), + (Token.Literal.Number.Integer, '1'), + (Token.Operator, '/'), + (Token.Literal.Number.Integer, '2'), + (Token.Punctuation, ';'), + (Token.Text, '\n'), ] assert list(lexer.get_tokens(fragment)) == tokens diff --git a/tests/test_cpp.py b/tests/test_cpp.py index e847079d..7b6d4db4 100644 --- a/tests/test_cpp.py +++ b/tests/test_cpp.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ CPP Tests ~~~~~~~~~ diff --git a/tests/test_crystal.py b/tests/test_crystal.py index ae0dd7ff..91ec8007 100644 --- a/tests/test_crystal.py +++ b/tests/test_crystal.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Basic CrystalLexer Test ~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_csound.py b/tests/test_csound.py index cee0784a..efb387c2 100644 --- a/tests/test_csound.py +++ b/tests/test_csound.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Csound lexer tests ~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_data.py b/tests/test_data.py index 5388910a..83e7c09e 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Data Tests ~~~~~~~~~~ diff --git a/tests/test_examplefiles.py b/tests/test_examplefiles.py index 102c154d..e4510ec4 100644 --- a/tests/test_examplefiles.py +++ b/tests/test_examplefiles.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Pygments tests with example files ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_ezhil.py b/tests/test_ezhil.py index beca4c65..7e1ee579 100644 --- a/tests/test_ezhil.py +++ b/tests/test_ezhil.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Basic EzhilLexer Test ~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_gdscript.py b/tests/test_gdscript.py index d52d8ff8..bed0fec1 100644 --- a/tests/test_gdscript.py +++ b/tests/test_gdscript.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ GDScript Tests ~~~~~~~~~~~~~~ diff --git a/tests/test_grammar_notation.py b/tests/test_grammar_notation.py index 1ac35f53..b0c56c82 100644 --- a/tests/test_grammar_notation.py +++ b/tests/test_grammar_notation.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Basic Grammar Notation Tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_haskell.py b/tests/test_haskell.py index a9a15bb3..c271d8b4 100644 --- a/tests/test_haskell.py +++ b/tests/test_haskell.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Haskell Tests ~~~~~~~~~~~~~ diff --git a/tests/test_hdl.py b/tests/test_hdl.py index cad3f348..3411147f 100644 --- a/tests/test_hdl.py +++ b/tests/test_hdl.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ HDL Tests ~~~~~~~~~ diff --git a/tests/test_html_formatter.py b/tests/test_html_formatter.py index 5138a1ce..3ed53e53 100644 --- a/tests/test_html_formatter.py +++ b/tests/test_html_formatter.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Pygments HTML formatter tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -24,7 +23,7 @@ from pygments.style import Style TESTDIR = path.dirname(path.abspath(__file__)) TESTFILE = path.join(TESTDIR, 'test_html_formatter.py') -with io.open(TESTFILE, encoding='utf-8') as fp: +with open(TESTFILE, encoding='utf-8') as fp: tokensource = list(PythonLexer().get_tokens(fp.read())) @@ -54,7 +53,7 @@ def test_external_css(): try: fmt2.format(tokensource, tfile) assert path.isfile(path.join(TESTDIR, 'fmt2.css')) - except IOError: + except OSError: # test directory not writable pass tfile.close() diff --git a/tests/test_html_lexer.py b/tests/test_html_lexer.py index 62f1c8d4..cdab6310 100644 --- a/tests/test_html_lexer.py +++ b/tests/test_html_lexer.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ HTML Lexer Tests ~~~~~~~~~~~~~~~~ diff --git a/tests/test_idris.py b/tests/test_idris.py index 42dcb3cb..e8c4b6de 100644 --- a/tests/test_idris.py +++ b/tests/test_idris.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Basic IdrisLexer Test ~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_inherit.py b/tests/test_inherit.py index 322ac148..74d04b7d 100644 --- a/tests/test_inherit.py +++ b/tests/test_inherit.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Tests for inheritance in RegexLexer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_irc_formatter.py b/tests/test_irc_formatter.py index d43e1122..4f0e9570 100644 --- a/tests/test_irc_formatter.py +++ b/tests/test_irc_formatter.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Pygments IRC formatter tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_java.py b/tests/test_java.py index f618f503..410c25ab 100644 --- a/tests/test_java.py +++ b/tests/test_java.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Basic JavaLexer Test ~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_javascript.py b/tests/test_javascript.py index ea0691d6..35225142 100644 --- a/tests/test_javascript.py +++ b/tests/test_javascript.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Javascript tests ~~~~~~~~~~~~~~~~ diff --git a/tests/test_julia.py b/tests/test_julia.py index 4c6be538..ee928861 100644 --- a/tests/test_julia.py +++ b/tests/test_julia.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Julia Tests ~~~~~~~~~~~ diff --git a/tests/test_kotlin.py b/tests/test_kotlin.py index 2c6c069c..8d67f83d 100644 --- a/tests/test_kotlin.py +++ b/tests/test_kotlin.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Basic JavaLexer Test ~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_latex_formatter.py b/tests/test_latex_formatter.py index 6609c6da..d22499aa 100644 --- a/tests/test_latex_formatter.py +++ b/tests/test_latex_formatter.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Pygments LaTeX formatter tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_lexers_other.py b/tests/test_lexers_other.py index b9292e30..910df9a9 100644 --- a/tests/test_lexers_other.py +++ b/tests/test_lexers_other.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Tests for other lexers ~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_make.py b/tests/test_make.py index cab0b1d8..70f368e3 100644 --- a/tests/test_make.py +++ b/tests/test_make.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ CMake Tests ~~~~~~~~~~~ diff --git a/tests/test_markdown_lexer.py b/tests/test_markdown_lexer.py index 7bffa9ea..32457b5a 100644 --- a/tests/test_markdown_lexer.py +++ b/tests/test_markdown_lexer.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Pygments Markdown lexer tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_matlab.py b/tests/test_matlab.py index 8f73e71e..945a3434 100644 --- a/tests/test_matlab.py +++ b/tests/test_matlab.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ MATLAB Tests ~~~~~~~~~~~ diff --git a/tests/test_modeline.py b/tests/test_modeline.py index 763a014e..9fa7c849 100644 --- a/tests/test_modeline.py +++ b/tests/test_modeline.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Tests for the vim modeline feature ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_mysql.py b/tests/test_mysql.py index 195140a5..c71cfb45 100644 --- a/tests/test_mysql.py +++ b/tests/test_mysql.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Pygments MySQL lexer tests ~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_objectiveclexer.py b/tests/test_objectiveclexer.py index 6940e4ca..d4ea6126 100644 --- a/tests/test_objectiveclexer.py +++ b/tests/test_objectiveclexer.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Basic CLexer Test ~~~~~~~~~~~~~~~~~ diff --git a/tests/test_perllexer.py b/tests/test_perllexer.py index dfab6dae..7c05ea88 100644 --- a/tests/test_perllexer.py +++ b/tests/test_perllexer.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Pygments regex lexer tests ~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_php.py b/tests/test_php.py index 6c2c9c90..fe67f4c2 100644 --- a/tests/test_php.py +++ b/tests/test_php.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ PHP Tests ~~~~~~~~~ diff --git a/tests/test_praat.py b/tests/test_praat.py index 3586236d..cb2758be 100644 --- a/tests/test_praat.py +++ b/tests/test_praat.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Praat lexer tests ~~~~~~~~~~~~~~~~~ diff --git a/tests/test_promql.py b/tests/test_promql.py index 4bd3d59f..5d04b6bb 100644 --- a/tests/test_promql.py +++ b/tests/test_promql.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Basic PromQLLexer Tests ~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_properties.py b/tests/test_properties.py index 3d7cdac3..5da3fb86 100644 --- a/tests/test_properties.py +++ b/tests/test_properties.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Properties Tests ~~~~~~~~~~~~~~~~ diff --git a/tests/test_python.py b/tests/test_python.py index ee36a331..12529d4a 100644 --- a/tests/test_python.py +++ b/tests/test_python.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Python Tests ~~~~~~~~~~~~ diff --git a/tests/test_qbasiclexer.py b/tests/test_qbasiclexer.py index c15fd93e..cedeb93f 100644 --- a/tests/test_qbasiclexer.py +++ b/tests/test_qbasiclexer.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Tests for QBasic ~~~~~~~~~~~~~~~~ diff --git a/tests/test_r.py b/tests/test_r.py index 663abbfa..ffd3f576 100644 --- a/tests/test_r.py +++ b/tests/test_r.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ R Tests ~~~~~~~ diff --git a/tests/test_rdf.py b/tests/test_rdf.py index fed18b30..e4c9d1ec 100644 --- a/tests/test_rdf.py +++ b/tests/test_rdf.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Basic RubyLexer Test ~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_regexlexer.py b/tests/test_regexlexer.py index a535a38a..45ae20b1 100644 --- a/tests/test_regexlexer.py +++ b/tests/test_regexlexer.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Pygments regex lexer tests ~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_regexopt.py b/tests/test_regexopt.py index 56fb7d54..22440b11 100644 --- a/tests/test_regexopt.py +++ b/tests/test_regexopt.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Tests for pygments.regexopt ~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_rtf_formatter.py b/tests/test_rtf_formatter.py index 16d2c88b..a6c048cd 100644 --- a/tests/test_rtf_formatter.py +++ b/tests/test_rtf_formatter.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Pygments RTF formatter tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_ruby.py b/tests/test_ruby.py index b52ab2f5..98654cc4 100644 --- a/tests/test_ruby.py +++ b/tests/test_ruby.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Basic RubyLexer Test ~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_shell.py b/tests/test_shell.py index 3445b6bb..7704c7eb 100644 --- a/tests/test_shell.py +++ b/tests/test_shell.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Basic Shell Tests ~~~~~~~~~~~~~~~~~ diff --git a/tests/test_smarty.py b/tests/test_smarty.py index fde9d69d..b7f7cc72 100644 --- a/tests/test_smarty.py +++ b/tests/test_smarty.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Basic SmartyLexer Test ~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_sql.py b/tests/test_sql.py index 5a2cadb8..590b0cd5 100644 --- a/tests/test_sql.py +++ b/tests/test_sql.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Pygments SQL lexers tests ~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_terminal_formatter.py b/tests/test_terminal_formatter.py index 9291ecbc..edc704d8 100644 --- a/tests/test_terminal_formatter.py +++ b/tests/test_terminal_formatter.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Pygments terminal formatter tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_textfmts.py b/tests/test_textfmts.py index f47f4e3c..f50a302e 100644 --- a/tests/test_textfmts.py +++ b/tests/test_textfmts.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Basic Tests for textfmts ~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_tnt.py b/tests/test_tnt.py index 3e217e3b..0dcfef39 100644 --- a/tests/test_tnt.py +++ b/tests/test_tnt.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Typograhic Number Theory tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_token.py b/tests/test_token.py index 14ab8af5..9f08fc25 100644 --- a/tests/test_token.py +++ b/tests/test_token.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Test suite for the token module ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_unistring.py b/tests/test_unistring.py index f10a3f0e..cf58d10d 100644 --- a/tests/test_unistring.py +++ b/tests/test_unistring.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Test suite for the unistring module ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_usd.py b/tests/test_usd.py index 8edebeab..ed474af1 100755 --- a/tests/test_usd.py +++ b/tests/test_usd.py @@ -1,5 +1,4 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- """Test that syntax highlighting for USD files works correctly.""" diff --git a/tests/test_using_api.py b/tests/test_using_api.py index c87aa8bc..40ed189d 100644 --- a/tests/test_using_api.py +++ b/tests/test_using_api.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Pygments tests for using() ~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/test_util.py b/tests/test_util.py index 899fc6d6..eb744381 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Test suite for the util module ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -156,7 +155,7 @@ def test_duplicates_removed_nonconsecutive(): def test_guess_decode(): # UTF-8 should be decoded as UTF-8 - s = util.guess_decode('\xff'.encode('utf-8')) + s = util.guess_decode('\xff'.encode()) assert s == ('\xff', 'utf-8') # otherwise, it could be latin1 or the locale encoding... @@ -172,7 +171,7 @@ def test_guess_decode_from_terminal(): s = util.guess_decode_from_terminal('\xff'.encode('utf-7'), Term) assert s == ('\xff', 'utf-7') - s = util.guess_decode_from_terminal('\xff'.encode('utf-8'), Term) + s = util.guess_decode_from_terminal('\xff'.encode(), Term) assert s == ('\xff', 'utf-8') diff --git a/tests/test_whiley.py b/tests/test_whiley.py index 82abee38..cc8248e8 100644 --- a/tests/test_whiley.py +++ b/tests/test_whiley.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Whiley Test ~~~~~~~~~~~ diff --git a/tests/test_yang.py b/tests/test_yang.py index 6dfab593..20bbaca6 100644 --- a/tests/test_yang.py +++ b/tests/test_yang.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ Basic Yang Test ~~~~~~~~~~~~~~~~~~~~ |