2626
2727 # ruff: noqa: E402
2828 from hypothesis import example , given , settings
29- from hypothesis .strategies import binary , characters , none , one_of , sampled_from , text
29+ from hypothesis .strategies import binary , characters , emails , none , one_of , sampled_from , text
3030
3131except ImportError :
3232 from .pytest_patcher import mark_class
@@ -48,7 +48,7 @@ def noop_strategy(*args, **kwargs):
4848 # define the decorator functions
4949 example = given = settings = noop_decorators_with_args
5050 # and stratgies using in decorators
51- binary = characters = none = one_of = sampled_from = text = noop_strategy
51+ binary = characters = emails , none = one_of = sampled_from = text = noop_strategy
5252
5353
5454try :
@@ -213,6 +213,7 @@ class FuzzGetUrls(WsgiSetup, ClientSetup):
213213
214214 @given (sampled_from (['@verbose' , '@page_size' , '@page_index' ]),
215215 one_of (characters (),text (min_size = 1 )))
216+ @example ("@verbose" , "1#" )
216217 @settings (max_examples = _max_examples ,
217218 deadline = 10000 ) # 10000ms
218219 def test_class_url_param_accepting_integer_values (self , param , value ):
@@ -224,17 +225,21 @@ def test_class_url_param_accepting_integer_values(self, param, value):
224225 query = '%s=%s' % (param , value )
225226 f = session .get (url , params = query )
226227 try :
228+ # test case '0#'
229+ if len (value ) > 1 and value [- 1 ] in ('#' , '&' ):
230+ value = value [:- 1 ]
227231 if int (value ) >= 0 :
228232 self .assertEqual (f .status_code , 200 )
229233 except ValueError :
230- if value in [ '#' , '&' ] :
234+ if value in ( '#' , '&' ) :
231235 self .assertEqual (f .status_code , 200 )
232236 else :
233237 # invalid value for param
234238 self .assertEqual (f .status_code , 400 )
235239
236240 @given (sampled_from (['@verbose' ]),
237241 one_of (characters (),text (min_size = 1 )))
242+ @example ("@verbose" , "1#" )
238243 @settings (max_examples = _max_examples ,
239244 deadline = 10000 ) # 10000ms
240245 def test_element_url_param_accepting_integer_values (self , param , value ):
@@ -246,6 +251,9 @@ def test_element_url_param_accepting_integer_values(self, param, value):
246251 query = '%s=%s' % (param , value )
247252 f = session .get (url , params = query )
248253 try :
254+ # test case '0#'
255+ if len (value ) > 1 and value [- 1 ] in ('#' , '&' ):
256+ value = value [:- 1 ]
249257 if int (value ) >= 0 :
250258 self .assertEqual (f .status_code , 200 )
251259 except ValueError :
@@ -255,7 +263,6 @@ def test_element_url_param_accepting_integer_values(self, param, value):
255263 # invalid value for param
256264 self .assertEqual (f .status_code , 400 )
257265
258-
259266@skip_requests
260267class BaseTestCases (WsgiSetup , ClientSetup ):
261268 """Class with all tests to run against wsgi server. Is reused when
0 commit comments