@@ -135,7 +135,11 @@ def test_uploadBlock_collection():
135135 #TODO: This is incomplete...
136136
137137def MockClient ():
138- from unittest .mock import seal #Python 3.7+ only!
138+ #No-op, seal doesn't exist in Python 3.6
139+ if sys .version_info >= (3 ,7 ,0 ):
140+ from unittest .mock import seal
141+ else :
142+ seal = lambda x : x
139143 notionClient = Mock ()
140144 notionClient .return_value = notionClient
141145 getBlock = Mock (spec = PageBlock )
@@ -157,15 +161,13 @@ def remove():
157161 seal (notionClient )
158162 return notionClient
159163
160- @pytest .mark .skipif (sys .version_info < (3 ,7 ), reason = "requires python3.7+" )
161164@patch ('notion.client.NotionClient' , new_callable = MockClient )
162165def test_cli_no_arguments (mockClient ):
163166 '''should error when nothing is passed'''
164167 #act/assert
165168 with pytest .raises (SystemExit ):
166169 cli ([])
167170
168- @pytest .mark .skipif (sys .version_info < (3 ,7 ), reason = "requires python3.7+" )
169171@patch ('md2notion.upload.upload' )
170172@patch ('notion.client.NotionClient' , new_callable = MockClient )
171173def test_cli_create_single_page (mockClient , upload ):
@@ -181,7 +183,6 @@ def test_cli_create_single_page(mockClient, upload):
181183 assert args0 [1 ] == mockClient .get_block .return_value .children [0 ]
182184 assert args0 [1 ].title == 'TEST.md'
183185
184- @pytest .mark .skipif (sys .version_info < (3 ,7 ), reason = "requires python3.7+" )
185186@patch ('md2notion.upload.upload' )
186187@patch ('notion.client.NotionClient' , new_callable = MockClient )
187188def test_cli_create_multiple_pages (mockClient , upload ):
@@ -199,7 +200,6 @@ def test_cli_create_multiple_pages(mockClient, upload):
199200 assert args1 [1 ] == mockClient .get_block .return_value .children [1 ]
200201 assert args1 [1 ].title == 'COMPREHENSIVE_TEST.md'
201202
202- @pytest .mark .skipif (sys .version_info < (3 ,7 ), reason = "requires python3.7+" )
203203@patch ('md2notion.upload.upload' )
204204@patch ('notion.client.NotionClient' , new_callable = MockClient )
205205def test_cli_append (mockClient , upload ):
@@ -214,7 +214,6 @@ def test_cli_append(mockClient, upload):
214214 assert args0 [0 ].name == 'tests/TEST.md'
215215 assert args0 [1 ] == mockClient .get_block .return_value
216216
217- @pytest .mark .skipif (sys .version_info < (3 ,7 ), reason = "requires python3.7+" )
218217@patch ('md2notion.upload.upload' )
219218@patch ('notion.client.NotionClient' , new_callable = MockClient )
220219def test_cli_clear_previous (mockClient , upload ):
0 commit comments