Skip to content

Commit 08036c7

Browse files
use 'sync' as sync I/O marker
1 parent 6a4d08c commit 08036c7

19 files changed

+92
-89
lines changed

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ filterwarnings =
1212
ignore:Legacy index templates are deprecated in favor of composable templates.:elasticsearch.exceptions.ElasticsearchWarning
1313
ignore:datetime.datetime.utcfromtimestamp\(\) is deprecated and scheduled for removal in a future version..*:DeprecationWarning
1414
markers =
15-
syncio: mark a test as performing I/O without asyncio.
15+
sync: mark a test as performing I/O without asyncio.

tests/_sync/test_document.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -571,21 +571,21 @@ def test_meta_fields_can_be_set_directly_in_init():
571571
assert md.meta.id is p
572572

573573

574-
@pytest.mark.syncio
574+
@pytest.mark.sync
575575
def test_save_no_index(mock_client):
576576
md = MyDoc()
577577
with raises(ValidationException):
578578
md.save(using="mock")
579579

580580

581-
@pytest.mark.syncio
581+
@pytest.mark.sync
582582
def test_delete_no_index(mock_client):
583583
md = MyDoc()
584584
with raises(ValidationException):
585585
md.delete(using="mock")
586586

587587

588-
@pytest.mark.syncio
588+
@pytest.mark.sync
589589
def test_update_no_fields():
590590
md = MyDoc()
591591
with raises(IllegalOperation):

tests/_sync/test_index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def test_index_template_can_have_order():
182182
assert {"index_patterns": ["i-*"], "order": 2} == it.to_dict()
183183

184184

185-
@pytest.mark.syncio
185+
@pytest.mark.sync
186186
def test_index_template_save_result(mock_client):
187187
it = IndexTemplate("test-template", "test-*")
188188

tests/_sync/test_search.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def test_expand__to_dot_is_respected():
3030
assert {"query": {"match": {"a__b": 42}}} == s.to_dict()
3131

3232

33-
@pytest.mark.syncio
33+
@pytest.mark.sync
3434
def test_execute_uses_cache():
3535
s = Search()
3636
r = object()
@@ -39,7 +39,7 @@ def test_execute_uses_cache():
3939
assert r is s.execute()
4040

4141

42-
@pytest.mark.syncio
42+
@pytest.mark.sync
4343
def test_cache_can_be_ignored(mock_client):
4444
s = Search(using="mock")
4545
r = object()
@@ -49,7 +49,7 @@ def test_cache_can_be_ignored(mock_client):
4949
mock_client.search.assert_called_once_with(index=None, body={})
5050

5151

52-
@pytest.mark.syncio
52+
@pytest.mark.sync
5353
def test_iter_iterates_over_hits():
5454
s = Search()
5555
s._response = [1, 2, 3]
@@ -518,7 +518,7 @@ def test_from_dict_doesnt_need_query():
518518
assert {"size": 5} == s.to_dict()
519519

520520

521-
@pytest.mark.syncio
521+
@pytest.mark.sync
522522
def test_params_being_passed_to_search(mock_client):
523523
s = Search(using="mock")
524524
s = s.params(routing="42")
@@ -608,7 +608,7 @@ def test_exclude():
608608
} == s.to_dict()
609609

610610

611-
@pytest.mark.syncio
611+
@pytest.mark.sync
612612
def test_delete_by_query(mock_client):
613613
s = Search(using="mock").query("match", lang="java")
614614
s.delete()
@@ -693,7 +693,7 @@ def test_rescore_query_to_dict():
693693
}
694694

695695

696-
@pytest.mark.syncio
696+
@pytest.mark.sync
697697
def test_empty_search():
698698
s = EmptySearch(index="index-name")
699699
s = s.query("match", lang="java")

tests/_sync/test_update_by_query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def test_from_dict_doesnt_need_query():
138138
assert {"script": {"source": "test"}} == ubq.to_dict()
139139

140140

141-
@pytest.mark.syncio
141+
@pytest.mark.sync
142142
def test_params_being_passed_to_search(mock_client):
143143
ubq = UpdateByQuery(using="mock")
144144
ubq = ubq.params(routing="42")

tests/test_integration/_sync/test_analysis.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from elasticsearch_dsl import analyzer, token_filter, tokenizer
2121

2222

23-
@pytest.mark.syncio
23+
@pytest.mark.sync
2424
def test_simulate_with_just__builtin_tokenizer(client):
2525
a = analyzer("my-analyzer", tokenizer="keyword")
2626
tokens = (a.simulate("Hello World!", using=client)).tokens
@@ -29,7 +29,7 @@ def test_simulate_with_just__builtin_tokenizer(client):
2929
assert tokens[0].token == "Hello World!"
3030

3131

32-
@pytest.mark.syncio
32+
@pytest.mark.sync
3333
def test_simulate_complex(client):
3434
a = analyzer(
3535
"my-analyzer",
@@ -43,7 +43,7 @@ def test_simulate_complex(client):
4343
assert ["this", "works"] == [t.token for t in tokens]
4444

4545

46-
@pytest.mark.syncio
46+
@pytest.mark.sync
4747
def test_simulate_builtin(client):
4848
a = analyzer("my-analyzer", "english")
4949
tokens = (a.simulate("fixes running")).tokens

0 commit comments

Comments
 (0)