Skip to content

Optionally skip test requiring mapproj #6444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 30, 2025

Conversation

MichaelChirico
Copy link
Contributor

The dependency of the test on {maptools} is not very transparent; here's the failure if {maptools} is not installed:

<rlib_error_package_not_found/rlang_error/error/condition> ('test-coord-map.R:55:3')
--------------------------------------------------------------------------------
<rlib_error_package_not_found/rlang_error/error/condition>
Error in `mproject(self, grid$x, grid$y, orientation)`: The package "mapproj" is required for `coord_map()`.
Backtrace:
     x
  1. +-testthat::expect_snapshot_warning(...) at test-coord-map.R:55:3
  2. | \-testthat:::expect_snapshot_condition(...)
  3. |   +-testthat:::with_is_snapshotting(...)
  4. |   \-testthat:::capture_matching_condition(x, cnd_matcher(class))
  5. |     \-base::withCallingHandlers(...)
  6. +-ggplot2::ggplot_build(ggplot() + coord_map() + guides(x = guide_axis()))
  7. \-ggplot2:::ggplot_build.ggplot(ggplot() + coord_map() + guides(x = guide_axis()))
  8.   \-layout$setup_panel_params()
  9.     \-ggplot2 (local) setup_panel_params(..., self = self)
 10.       \-base::Map(setup_panel_params, scales_x, scales_y)
 11.         \-base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
 12.           \-ggplot2 (local) `<fn>`(dots[[1L]][[1L]], dots[[2L]][[1L]])
 13.             \-self$coord$setup_panel_params(scale_x, scale_y, params = self$coord_params)
 14.               \-ggplot2 (local) setup_panel_params(..., self = self)
 15.                 \-ggplot2:::mproject(self, grid$x, grid$y, orientation)
 16.                   \-rlang::check_installed("mapproj", reason = "for `coord_map()`.")

Somewhat scary unless you're all-too-accustomed to seeing such errors :)

Copy link
Collaborator

@teunbrand teunbrand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks for the PR!

@teunbrand teunbrand merged commit 295f5cb into tidyverse:main Apr 30, 2025
13 checks passed
@MichaelChirico MichaelChirico changed the title Optionally skip test requiring maptools Optionally skip test requiring mapproj Apr 30, 2025
@MichaelChirico MichaelChirico deleted the patch-3 branch April 30, 2025 18:12
@MichaelChirico
Copy link
Contributor Author

Whoops, I just realized my typo in the commit message: s/maptools/mapproj. Sorry for the mistake in the history; I've updated the PR title.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants