diff --git a/docs/content/concepts/assets/software-defined-assets.mdx b/docs/content/concepts/assets/software-defined-assets.mdx index 52ea9001848b2..0968f0092c424 100644 --- a/docs/content/concepts/assets/software-defined-assets.mdx +++ b/docs/content/concepts/assets/software-defined-assets.mdx @@ -562,7 +562,7 @@ When writing a unit test, use to mock the ```python file=/concepts/assets/asset_testing.py startafter=start_test_with_context_asset endbefore=end_test_with_context_asset def test_uses_context(): - context = build_op_context() + context = build_asset_context() result = uses_context(context) assert result == "bar" ``` diff --git a/docs/content/concepts/testing.mdx b/docs/content/concepts/testing.mdx index 022bd0094ff15..7ad0465b502d9 100644 --- a/docs/content/concepts/testing.mdx +++ b/docs/content/concepts/testing.mdx @@ -333,7 +333,7 @@ def test_asset_with_inputs(): If your asset has a config schema, you can pass a config value to the invocation. The following asset relies on attached config: ```python file=/concepts/ops_jobs_graphs/unit_tests.py startafter=start_test_config_asset endbefore=end_test_config_asset -from dagster import asset, Config, build_op_context +from dagster import asset, Config class MyAssetConfig(Config): @@ -357,7 +357,7 @@ If your asset requires resources, you can specify them as arguments when invokin Consider the following asset, which requires a resource `foo`. ```python file=/concepts/ops_jobs_graphs/unit_tests.py startafter=start_test_resource_asset endbefore=end_test_resource_asset -from dagster import asset, ConfigurableResource, build_op_context, with_resources +from dagster import asset, ConfigurableResource class BarResource(ConfigurableResource): diff --git a/docs/content/guides/dagster/transitioning-data-pipelines-from-development-to-production.mdx b/docs/content/guides/dagster/transitioning-data-pipelines-from-development-to-production.mdx index db8a5cf4f3b94..fec5cd0d2813f 100644 --- a/docs/content/guides/dagster/transitioning-data-pipelines-from-development-to-production.mdx +++ b/docs/content/guides/dagster/transitioning-data-pipelines-from-development-to-production.mdx @@ -400,9 +400,9 @@ Now we can use the stub Hacker News resource to test that the `items` asset tran def test_items(): - context = build_op_context( + context = build_asset_context( resources={"hn_client": StubHNClient()}, - op_config={"N": StubHNClient().fetch_max_item_id()}, + asset_config={"N": StubHNClient().fetch_max_item_id()}, ) hn_dataset = items(context) assert isinstance(hn_dataset, pd.DataFrame)