Mayor Marty Walsh announced Thursday a COVID-19 “Testing Pledge” for Boston residents and businesses as part of a citywide “call to action” by the mayor to expand testing.

The “Pledge,” essentially a promotional public service program, aims to increase the amount and reach of testing throughout Boston by encouraging residents to “take the pledge,” to get tested, whether symptomatic or not. It also asks businesses to pledge to encourage their employees to get tested and facilitate employee testing by allowing testing during work hours or providing other accommodations.

Walsh says mass testing is critical to containing the spread of the virus and to identifying hot spots or particularly vulnerable communities.

“Testing is how you keep yourself [and your] family safe, and it's also how we track the presence of the virus in our community,” in order to better respond to the public health crisis, Walsh said. “I'm asking everyone to commit to getting tested for COVID-19.”

Walsh is urging anyone who has been exposed to a known risk factor — including exposure to someone who has tested positive for COVID-19 or is symptomatic; anyone with a household member who may have been exposed to the virus; and anyone who has recently attended a large gathering or traveled — to get tested “without delay.”

“But as a city we want to move further than that,” Walsh said. “We know the virus is spreading among people who don't have symptoms and among people who don't know they’ve been exposed. … Leaving your house, for any reason, you could be exposed.”

COVID-19 cases are on the rise across the state, and Boston has seen infection rates rise more sharply. The city is now recording a positive test rate of above 8 percent, up from two percent or lower just over one month ago. Infection rates have increased steadily for about five weeks straight, Walsh said.

Boston leads the state in testing sites, with over 30 testing facilities around the city, including several “mobile” testing sites, open at different locations around Boston on different days of the week. The city is also offering free testing to anyone, resident, or non-resident, symptomatic or not, and with or without insurance.

Other testing facilities, including community health centers, may require appointments, Walsh said. Testing sites, hours and other details can be found on the city’s website.

Walsh also spoke about the upcoming general election and the city’s preparations for an unusually anxiety-ridden election day.

Walsh said he is aware of no credible threats of violence, vandalism or other mayhem to the city or statewide — but expressed concern over heightened tensions and feelings of mistrust.

“I’m pretty confident that in Massachusetts the results will be called early … but they’re talking about possibly days of delay before the results are found out,” the mayor said.

“We are preparing for any demonstration that may happen … I’m anticipating there will be demonstrations, there will be demonstrations on both sides,” he continued. “I’m just asking everyone, regardless of what happens Tuesday night, be respectful of each other.”