Skip to content

Commit 81b0963

Browse files
gfyoung3553x
authored andcommitted
Revert "ENH: Create a 'Y' alias for date_range yearly frequency" (pandas-dev#16976)
This reverts commit 9c096d2, as it was prematurely made.
1 parent 7ffe7fc commit 81b0963

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

pandas/tests/io/test_html.py

+28
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,19 @@
33
import glob
44
import os
55
import re
6+
import threading
67
import warnings
78

89
try:
910
from importlib import import_module
1011
except ImportError:
1112
import_module = __import__
1213

14+
try:
15+
from importlib import reload
16+
except ImportError:
17+
pass
18+
1319
from distutils.version import LooseVersion
1420

1521
import pytest
@@ -22,6 +28,7 @@
2228
from pandas.compat import (map, zip, StringIO, string_types, BytesIO,
2329
is_platform_windows, PY3)
2430
from pandas.io.common import URLError, urlopen, file_path_to_url
31+
import pandas.io.html
2532
from pandas.io.html import read_html
2633
from pandas._libs.parsers import ParserError
2734

@@ -931,3 +938,24 @@ def test_same_ordering():
931938
dfs_lxml = read_html(filename, index_col=0, flavor=['lxml'])
932939
dfs_bs4 = read_html(filename, index_col=0, flavor=['bs4'])
933940
assert_framelist_equal(dfs_lxml, dfs_bs4)
941+
942+
class ErrorThread(threading.Thread):
943+
def run(self):
944+
try:
945+
super(ErrorThread, self).run()
946+
except Exception as e:
947+
self.err = e
948+
else:
949+
self.err = None
950+
951+
@pytest.mark.slow
952+
def test_importcheck_thread_safety():
953+
reload(pandas.io.html)
954+
filename = os.path.join(DATA_PATH, 'valid_markup.html')
955+
helper_thread1 = ErrorThread(target = read_html, args = (filename,))
956+
helper_thread2 = ErrorThread(target = read_html, args = (filename,))
957+
helper_thread1.start()
958+
helper_thread2.start()
959+
while(helper_thread1.is_alive() or helper_thread2.is_alive()):
960+
pass
961+
assert None == helper_thread1.err == helper_thread2.err

0 commit comments

Comments
 (0)