Skip to content

Commit

Permalink
handle ENAMETOOLONG when creating a request task with source in conte…
Browse files Browse the repository at this point in the history
…xt text.
  • Loading branch information
mgor committed Dec 6, 2023
1 parent 45af414 commit fa4120e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion grizzly/steps/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import json
import logging
import re
from errno import ENAMETOOLONG
from pathlib import Path
from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Type, cast
from urllib.parse import urlparse
Expand Down Expand Up @@ -69,7 +70,11 @@ def _create_request_task(
source = fd.read()

template = j2env.get_template(source)
except j2.exceptions.TemplateNotFound:
except (j2.exceptions.TemplateNotFound, OSError) as e:
# `TemplateNotFound` inherits `OSError`...
if not isinstance(e, j2.exceptions.TemplateNotFound) and e.errno != ENAMETOOLONG:
raise

if name is None:
name = original_source.replace(''.join(Path(original_source).suffixes), '')

Expand Down
2 changes: 1 addition & 1 deletion grizzly/users/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## Custom
It is possible to implement custom users, the only requirement is that they inherit `grizzly.users.base.GrizzlyUser`. To get them to be executed by `grizzly`
It is possible to implement custom users, the only requirement is that they inherit `grizzly.users.GrizzlyUser`. To get them to be executed by `grizzly`
the full namespace has to be specified as `user_class_name` in the scenarios {@pylink grizzly.steps.scenario.user} step.
There are examples of this in the {@link framework.example}.
Expand Down

0 comments on commit fa4120e

Please sign in to comment.