Skip to content

Data providers don't work when changing directory in set_up_before_script #529

@sandr01d

Description

@sandr01d
Q A
OS Linux
Shell & version bash 5.3.3
bashunit version 0.28.0

Summary

When changing the directory in set_up_before_script data providers stop working.

Current behavior

When the directory is changed in the set_up_before_script function, no arguments are passed to the test function from the data provider.

How to reproduce

Here is a minimal example:

#!/usr/bin/env bash

function set_up_before_script() {
    cd "$(temp_dir)" || return 1
}

# @data_provider provider_x
function test_x() {
    assert_equals data "$1"
}

function provider_x() {
    data_set data
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions