Skip to content

Commit

Permalink
fix unicode
Browse files Browse the repository at this point in the history
  • Loading branch information
BjornFJohansson committed Nov 15, 2016
1 parent d459f1e commit 191b646
Show file tree
Hide file tree
Showing 17 changed files with 23 additions and 20 deletions.
1 change: 1 addition & 0 deletions tests/test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
䔀 blah blah blah
2 changes: 1 addition & 1 deletion tests/test_amplify.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,4 +271,4 @@ def test_pcr():
assert tst[0] == seguid(pcr(tst[1:]).seq)

if __name__ == '__main__':
nose.runmodule(argv=[sys.argv[0], '--nocapture'])
pytest.cmdline.main([__file__, "-v", "-s"])
2 changes: 1 addition & 1 deletion tests/test_assemble_MX4blaster12.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,4 @@ def test_MXblaster1():


if __name__ == '__main__':
nose.runmodule(argv=[sys.argv[0], '--nocapture'])
pytest.cmdline.main([__file__, "-v", "-s"])
2 changes: 1 addition & 1 deletion tests/test_assemble_YEp24PGK_XK.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_empty():
assert pydna.eq(YEp24PGK_XK, YEp24PGK_XK_correct)

if __name__ == '__main__':
nose.runmodule(argv=[sys.argv[0], '--nocapture'])
pytest.cmdline.main([__file__, "-v", "-s"])



Expand Down
2 changes: 1 addition & 1 deletion tests/test_assemble_pGUP1.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ def test_empty():
assert pGUP1.seguid() == "42wIByERn2kSe_Exn405RYwhffU"

if __name__ == '__main__':
nose.runmodule(argv=[sys.argv[0], '--nocapture'])
pytest.cmdline.main([__file__, "-v", "-s"])
2 changes: 1 addition & 1 deletion tests/test_assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def test_assembly():
print("done!", time.time()-start)

if __name__ == '__main__':
nose.runmodule(argv=[sys.argv[0], '--nocapture'])
pytest.cmdline.main([__file__, "-v", "-s"])



Expand Down
2 changes: 1 addition & 1 deletion tests/test_cut_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ def amplicon_to_dseqrecord(a):
assert len(pcrProdDseqrecord.cut(EcoRI)[1].features) == 17

if __name__ == '__main__':
nose.runmodule(argv=[sys.argv[0], '--nocapture'])
pytest.cmdline.main([__file__, "-v", "-s"])
2 changes: 1 addition & 1 deletion tests/test_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def test_pydna_download():
os.environ["pydna_cache"] = cachevar

if __name__ == '__main__':
nose.runmodule(argv=[sys.argv[0], '--nocapture'])
pytest.cmdline.main([__file__, "-v", "-s"])



2 changes: 1 addition & 1 deletion tests/test_dsdna.py
Original file line number Diff line number Diff line change
Expand Up @@ -875,5 +875,5 @@ def test_synced2():
print()

if __name__ == '__main__':
nose.runmodule(argv=[sys.argv[0], '--nocapture'])
pytest.cmdline.main([__file__, "-v", "-s"])

2 changes: 1 addition & 1 deletion tests/test_genbankfixer.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ def test_pydna_gbtext_clean():
#print('"'+calcseg+'"),')

if __name__ == '__main__':
nose.runmodule(argv=[sys.argv[0], '--nocapture'])
pytest.cmdline.main([__file__, "-v", "-s"])
2 changes: 1 addition & 1 deletion tests/test_import_ipynb.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ def test_ipynb_import():
assert mynotebook.foo() == "bar"

if __name__ == '__main__':
nose.runmodule(argv=[sys.argv[0], '--nocapture'])
pytest.cmdline.main([__file__, "-v", "-s"])
2 changes: 1 addition & 1 deletion tests/test_map_reads.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,5 @@ def test_map2():


if __name__ == '__main__':
nose.runmodule(argv=[sys.argv[0], '--nocapture'])
pytest.cmdline.main([__file__, "-v", "-s"])

2 changes: 1 addition & 1 deletion tests/test_markbudde.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ def test_empty():
"""

if __name__ == '__main__':
nose.runmodule(argv=[sys.argv[0], '--nocapture'])
pytest.cmdline.main([__file__, "-v", "-s"])
2 changes: 1 addition & 1 deletion tests/test_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def test_parse2():


if __name__ == '__main__':
nose.runmodule(argv=[sys.argv[0], '--nocapture'])
pytest.cmdline.main([__file__, "-v", "-s"])



Expand Down
12 changes: 7 additions & 5 deletions tests/test_pretty.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,29 @@

def test_pretty():

x= u'/label="2micron 2µ"'
print(sys.getdefaultencoding())
import locale
print(locale.getpreferredencoding())

import io
from Bio import SeqIO
from Bio.Alphabet.IUPAC import IUPACAmbiguousDNA

raw = open("pydna_read_test.txt", 'r').read()
raw = open("pydna_read_test.txt", 'r', encoding="UTF8").read()

handle = io.StringIO(raw)

sr = SeqIO.read(handle, "genbank", alphabet=IUPACAmbiguousDNA())

s = sr.format("gb").strip()

assert s[559:578] == x
assert s[559:578] == '/label="2micron 2µ"'

y = pydna._pretty.pretty_string( s[:55]+"circular"+s[63:] )[559:578]

assert x==y
assert '/label="2micron 2µ"'==y

assert pydna.read("pydna_read_test.txt").format("gb")[559:578] == x
assert pydna.read("pydna_read_test.txt").format("gb")[559:578] == '/label="2micron 2µ"'

if __name__ == '__main__':
pytest.cmdline.main([__file__, "-v", "-s"])
2 changes: 1 addition & 1 deletion tests/test_primer_design.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,4 +219,4 @@ def test_primer_Design_saving_to_text_file():
assert r.description == "rv64 t-sequence"

if __name__ == '__main__':
nose.runmodule(argv=[sys.argv[0], '--nocapture'])
pytest.cmdline.main([__file__, "-v", "-s"])
2 changes: 1 addition & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,4 @@ def test_cseguid():


if __name__ == '__main__':
nose.runmodule(argv=[sys.argv[0], '--nocapture'])
pytest.cmdline.main([__file__, "-v", "-s"])

0 comments on commit 191b646

Please sign in to comment.