Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Handle Path object #157

Copy link
Copy link
@damienflament

Description

@damienflament
Issue body actions

Currently, files assertions are made on strings. It would be handy to accept pathlib.Path objects as it is what the pytest tmp_path fixture returns :

from assertpy import assert_that

def test_foo(tmp_path):
  f = tmp_path / "bar"
  f.touch()
  
  asset_that(f).is_a_file()

fails with :

TypeError: val is not a path

You need to make it a string :

assert_that(str(f)).is_a_file()
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.