Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ jobs:
fail-fast: false
matrix:
include:
- tox_env: py27-m_ans-ans2.10
- tox_env: py27-m_ans-ans4

- tox_env: py36-m_ans-ans2.10
- tox_env: py36-m_ans-ans4

- tox_env: py27-m_mtg
- tox_env: py36-m_mtg

Expand Down Expand Up @@ -86,34 +80,6 @@ jobs:
fail-fast: false
matrix:
include:
- tox_env: py311-m_ans-ans2.10
python_version: '3.11'
- tox_env: py311-m_ans-ans3
python_version: '3.11'
- tox_env: py311-m_ans-ans4
python_version: '3.11'
- tox_env: py311-m_ans-ans5
python_version: '3.11'
- tox_env: py313-m_ans-ans6
python_version: '3.13'
- tox_env: py313-m_ans-ans7
python_version: '3.13'
- tox_env: py313-m_ans-ans8
python_version: '3.13'
- tox_env: py314-m_ans-ans9
python_version: '3.14'
- tox_env: py314-m_ans-ans10
python_version: '3.14'
- tox_env: py314-m_ans-ans11
python_version: '3.14'
- tox_env: py314-m_ans-ans12
python_version: '3.14'
- tox_env: py314-m_ans-ans13
python_version: '3.14'

- tox_env: py314-m_ans-ans13-s_lin
python_version: '3.14'

- tox_env: py314-m_mtg
python_version: '3.14'

Expand Down Expand Up @@ -161,11 +127,6 @@ jobs:
fail-fast: false
matrix:
include:
- tox_env: py314-m_lcl-ans13
python_version: '3.14'
- tox_env: py314-m_lcl-ans13-s_lin
python_version: '3.14'

- tox_env: py314-m_mtg
python_version: '3.14'

Expand Down
Empty file.
2 changes: 2 additions & 0 deletions tests/data/importer/nonascii_pkg/hej_världen.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def hej():
return "This module is named 'Hello world', in Swedish"
Empty file.
10 changes: 10 additions & 0 deletions tests/data/importer/nonascii_pkg/undeclared/ascii.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""
>>> print(string_literal())
Sphinx of black quartz, judge my vow.
"""

def doc_string():
return __doc__

def string_literal():
return u'Sphinx of black quartz, judge my vow.'
10 changes: 10 additions & 0 deletions tests/data/importer/nonascii_pkg/undeclared/utf8.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""
>>> print(string_literal())
Hello world, Καλημέρα κόσμε, コンニチハ
"""

def doc_string():
return __doc__

def string_literal():
return u'Hello world, Καλημέρα κόσμε, コンニチハ'
Empty file.
10 changes: 10 additions & 0 deletions tests/data/importer/nonascii_pkg/with_bom/utf8.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""
>>> print(string_literal())
Hello world, Καλημέρα κόσμε, コンニチハ
"""

def doc_string():
return __doc__

def string_literal():
return u'Hello world, Καλημέρα κόσμε, コンニチハ'
Empty file.
11 changes: 11 additions & 0 deletions tests/data/importer/nonascii_pkg/with_coding/ascii.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# -*- coding: ascii -*-
"""
>>> print(string_literal())
Sphinx of black quartz, judge my vow.
"""

def doc_string():
return __doc__

def string_literal():
return u'Sphinx of black quartz, judge my vow.'
11 changes: 11 additions & 0 deletions tests/data/importer/nonascii_pkg/with_coding/cp1252.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# -*- coding: cp1252 -*-
"""
>>> print(string_literal())
Hello euro sign, Ol� �, Hello trademark, Hello �
"""

def doc_string():
return __doc__

def string_literal():
return u'Hello euro sign, Ol� �, Hello trademark, Hello �'
11 changes: 11 additions & 0 deletions tests/data/importer/nonascii_pkg/with_coding/iso8859_15.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# -*- coding: iso-8859-15 -*-
"""
>>> print(string_literal())
Hello euro sign, Hello �
"""

def doc_string():
return __doc__

def string_literal():
return u'Hello euro sign, Hello �'
11 changes: 11 additions & 0 deletions tests/data/importer/nonascii_pkg/with_coding/latin1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# -*- coding: latin1 -*-
"""
>>> print(string_literal())
Hello world, Ol� mundo, Hej v�rlden
"""

def doc_string():
return __doc__

def string_literal():
return u'Hello world, Ol� mundo, Hej v�rlden'
11 changes: 11 additions & 0 deletions tests/data/importer/nonascii_pkg/with_coding/utf8.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# -*- coding: utf-8 -*-
"""
>>> print(string_literal())
Hello world, Καλημέρα κόσμε, コンニチハ
"""

def doc_string():
return __doc__

def string_literal():
return u'Hello world, Καλημέρα κόσμε, コンニチハ'
61 changes: 61 additions & 0 deletions tests/import_encoding_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# -*- coding: utf-8 -*-
import sys
import unittest

import testlib

import nonascii_pkg.with_bom.utf8
import nonascii_pkg.with_coding.cp1252
import nonascii_pkg.with_coding.iso8859_15
import nonascii_pkg.with_coding.latin1
import nonascii_pkg.with_coding.utf8


class UndeclaredTest(testlib.RouterMixin, testlib.TestCase):
@unittest.skipIf(sys.version_info < (3, 0), 'Python 2.x, default source encoding is ascii')
def test_utf8(self):
import nonascii_pkg.undeclared.utf8
conn = self.router.local(python_path='python3')
self.assertEqual(
u'Hello world, Καλημέρα κόσμε, コンニチハ',
conn.call(nonascii_pkg.with_bom.utf8.string_literal),
)


class WithBomTest(testlib.RouterMixin, testlib.TestCase):
def test_utf8(self):
conn = self.router.local()
self.assertEqual(
u'Hello world, Καλημέρα κόσμε, コンニチハ',
conn.call(nonascii_pkg.with_bom.utf8.string_literal),
)


class WithCodingTest(testlib.RouterMixin, testlib.TestCase):
def test_cp1252(self):
conn = self.router.local()
self.assertEqual(
u'Hello euro sign, Olá €, Hello trademark, Hello ™',
conn.call(nonascii_pkg.with_coding.cp1252.string_literal),
)

def test_iso8859_15(self):
conn = self.router.local()
self.assertEqual(
u'Hello euro sign, Hello €',
conn.call(nonascii_pkg.with_coding.iso8859_15.string_literal),
)

def test_latin1(self):
conn = self.router.local()
self.assertEqual(
u'Hello world, Olá mundo, Hej världen',
conn.call(nonascii_pkg.with_coding.latin1.string_literal),
)

def test_utf8(self):
conn = self.router.local()
self.assertEqual(
u'Hello world, Καλημέρα κόσμε, コンニチハ',
conn.call(nonascii_pkg.with_coding.utf8.string_literal),
)